package com.dys.ai.config;

import org.springframework.ai.chat.client.RequestResponseAdvisor;
import org.springframework.ai.chat.client.advisor.api.AdvisedRequest;

import java.util.Map;

/**
 * 拦截对话记录: 记录聊天日志记录，方便分析整个聊天对话记录
 */
public class LoggingAdvisor implements RequestResponseAdvisor {

    @Override
    public AdvisedRequest adviseRequest(AdvisedRequest request, Map<String, Object> adviseContext) {
        System.out.println("拦截请求："+request);
        return request;
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
